<%--
  Created by IntelliJ IDEA.
  User: 今天要吃三碗饭
  Date: 2025/1/3
  Time: 22:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>注册成功提示</title>
  <style>
    /* 其他样式保持不变，这里只添加提示框的样式 */
    .success-message {
      display: none;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      padding: 20px;
      background-color: #dff0d8;
      color: #3c763d;
      border: 1px solid #d6e9c6;
      border-radius: 4px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      z-index: 1000;
    }
  </style>
</head>
<body>
<!-- 注册成功提示框 -->
<div class="success-message">
  <h3>注册成功！</h3>
  <p>您的账户已创建，现在可以登录了。</p>
  <a href="<%=request.getContextPath()%>/login.jsp">返回登陆</a>
</div>

<script>
  // 假设注册表单提交后，服务器返回的状态码为200表示注册成功
  function showSuccessMessage() {
    const successMessage = document.querySelector('.success-message');
    successMessage.style.display = 'block';
    // 3秒后自动关闭提示框
    setTimeout(function() {
      successMessage.style.display = 'none';
    }, 3000);
  }

  // 模拟表单提交后的成功回调
  showSuccessMessage();
</script>
</body>
</html>